package util;

import java.util.HashMap;

public class ThreadTracker {

	private static final HashMap<Long, Boolean> activeThreads
	= new HashMap<Long, Boolean>();
	
	public static void started(long id){
		activeThreads.put(id, true);
	}
	
	public static void ended(long id){
		activeThreads.put(id, false);
	}
	
	public static void printReport(){
		System.err.println("There were "+activeThreads.size()+" threads.");
		for(Long id : activeThreads.keySet()){
			boolean active = activeThreads.get(id);
			if(active){
				System.err.println("THERE IS AN ACTIVE THREAD OF ID "+id);
			}
		}
	}
}
